﻿@model PagedList.IPagedList<BanDTBLL.san_pham>
           
@{
    ViewBag.Title = "TheoLoaiSanPham";
}

<div style="float:left; display: block;">
<table cellpadding="0" cellspacing="0" border="1" width="575">
    <tr>
        <td style="text-align: center; height: 40px; font-size: 20px; font-weight: bold;">Danh sách sản phẩm</td>
    </tr>
</table>
</div>
<div style="float:left; display: block; margin-left: -10px; width: 595px;">
    @foreach (var item in Model)
    {
    <a href="@Url.Content("~/SanPham/Detail/" + @item.ma)" style="border: 0px;">
    <div style="width: 280px; height: 400px; float: left; display: block; margin-left: 10px; margin-top: 10px; border-width: 1px; border-style: solid; border-color: #000;">
        
        <div style ="width :280px; height: 280px; float : left ; display : block ;">
            <img src="@Url.Content("~/Content/Images/sanpham/" + @item.hinh )" style ="width : 280px; max-height: 280px;" />
        </div> 
        <div style =" width 280px; float : left ; display: block ; margin-top: 10px;">
            <table cellpadding="0" cellspacing="0"  width="280px">
                <tr>
                    <td style="text-align: left; height: 20px; font-size: 15px; padding-left: 10px; width: 90px;">Sản Phẩm:</td>
                    <td style="text-align: left; height: 20px; font-size: 15px;">@item.ten  </td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 20px; font-size: 15px; padding-left: 10px; ">Đơn Giá:</td>
                    <td style="text-align: left; height: 20px; font-size: 15px;">@item.donGia   </td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 20px; font-size: 15px; padding-left: 10px; ">Hãng:</td>
                    <td style="text-align: left; height: 20px; font-size: 15px;">@item.loai_san_pham.tenLoai   </td>
                </tr>
            </table> 
        </div>
    </div>
    </a>
    }
</div>

<div style="float:left; display: block; width: 575px; text-align: right; margin-top: 20px;">
    Trang @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    / @Model.PageCount :
     
    @if (Model.HasPreviousPage)
    {
        
        @Html.ActionLink("Đầu", "TheoLoaiSanPham", new { page = 1, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }, new { style = "border-style: solid; border-width: 1px; border-color: #000; padding: 5px; margin-left: 5px;" })
        @Html.Raw(" ");
        @Html.ActionLink("Trở lại", "TheoLoaiSanPham", new { page = Model.PageNumber - 1, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }, new { style = "border-style: solid; border-width: 1px; border-color: #000; padding: 5px; margin-left: 5px;" })
    }
    else
    {
        
        @:Đầu
        @Html.Raw(" ");
        @:Trở lại
    }
     
    @if (Model.HasNextPage)
    {
        @: | 
        @Html.ActionLink("Tiếp theo", "TheoLoaiSanPham", new { page = Model.PageNumber + 1, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }, new { style = "border-style: solid; border-width: 1px; border-color: #000; padding: 5px; margin-left: 5px;" })
        @Html.Raw(" ");
        @Html.ActionLink("Cuối", "TheoLoaiSanPham", new { page = Model.PageCount, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }, new { style = "border-style: solid; border-width: 1px; border-color: #000; padding: 5px; margin-left: 5px;" })
    }
    else
    {
        @: | 
        @:Tiếp theo
        @Html.Raw(" ")
        @:Cuối
    }
</div>
